package com.xingbang.uitl.log;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
/**
 * @author zchcpy
 */
public class MyLogUtil {
	public static void writeLogToFile(String path, String name, String content, boolean isAppend) {
		BufferedWriter out = null;
		try {
			path = path + "/" + name;
			out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path, isAppend), StandardCharsets.UTF_8));
			out.write(content);
			out.flush();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			try {
				if(out != null) {
					out.close();
				}
			}
			catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
